package com.oazon.system.handler;

import com.moco.launcher.play.MediaController;
import com.oazon.moco.link.bean.BatteryInfo;
import com.oazon.moco.link.core.LinkEventController;
import com.oazon.moco.link.core.LinkSDK;
import com.oazon.system.SysActionChannal;
import com.oazon.system.action.StandByAcion;
import com.oazon.system.core.IActionMessage;
import com.oazon.system.core.IActionhandler;

public class ScreenProtectHandler implements IActionhandler {

	public ScreenProtectHandler() {
	}

	/**
	 * 如果当前是暂停状态则进入待机倒计时30分钟
	 * 
	 */
	@Override
	public void getIn(IActionMessage actionMessage) {
		LinkSDK.getInstance().isScreenProtect(LinkEventController.systemEventSource);
	}

	@Override
	public void getOut() {
		SysActionChannal.getInstance().doAction(new StandByAcion());
	}
	
	@Override
	public long getTimeOut() {
		if(BatteryInfo.isDC){
			return DC_IN_SCREEN_PROTECT_TIME_COUNT;
		}
		return SCREEN_PROTECT_TIME_COUNT;
	}

	@Override
	public boolean isPauseTimer() {
		return MediaController.getInstance().isPlaying();
	}
}
